﻿#ifndef QMLSIGNAL_H
#define QMLSIGNAL_H

#include <QObject>
#include <QDebug>
#include <QTimer>

#include "logHelper/debugLog.h"

class QMLSignal : public QObject
{
    Q_OBJECT
private:
    QMLSignal();

public:
    static QMLSignal& I();

    // 用来测试的
    Q_INVOKABLE void sendErrorMsg_Process();
    Q_INVOKABLE void sendErrorMsg_Union();


signals:
    void experimentStatus(int type, int status,QString msg);//发送实验状态
    void refExperimentLog(int step);//刷新实验日志
    void communicationStatus(int status);//0连接成功 1通信断开
    void voiceAssistant(int status);//0连接成功 1通信断开
    void energySpectrumStatus(int status);
    void refCommunicationLog();//刷新通信日志
    void sendErrorMsg(QString errorInfo,QString methodInfo,QString errorModule,int errorType);// “是”“否” 发送错误信息
    void sendResetMsg(QString status,int serial);          //发送复位信息1开始 0完成
    void sendSyringRunMsg(QString status,QString serial);//发送注射器运行信息
    void syringDataLack();//注射器参数缺失
    void sendAirPumpPressure(QString openVal,QString closeVal);//维护校正中 气泵数据
    void sendTurnTablePos(QString turnTableVal);//维护校正中 转盘数据
    void moduleFinish(int module);
    void moduleCurrent(int module);
    void stepRunningStatus(int status);
    void receiveMsgOutTime();

    void sendOpenRunningStep(QString openRunningStep);
    void sendOpenLidStep(QString speed,QString step);
    void sendTargetDelivery(QString step);
    void sendTargetAirPumpPressure(QString airValue);

    void sendExistExp(int module,int step,QString actionInfo,int nextModule,int nextStep,QString nextActionInfo);

    void getExperimentInfo();
    void getHeliumGasPump(QString pressureValue);
    void getSuctionCupPressure(QString suctionCupValue);
    void getMotorPosition(QString motorPos);
    void getScrewCapInfo(QString speed,QString step);
    void sendPauseConfirmation();
    void targetGasPumpValue(QString value);
    void targetAirPumpValue(QString value);

    void fbGetAir(QString airValue);
    void dbhqGetAir(QString airValue);
    void dbxqbGetAir(QString airValue);
    void zbxpGetAir(QString airValue1,QString airValue2);
    void zbZZ(QString sd,QString wz);
    void zbXZ(QString sd,QString wz);
    void zbKG(QString sd,QString wz);
    void zbHX(QString sd,QString wz);
    void zbXPDJ(QString sd,QString wz);
    void zbRD(QString wz,QString sd);
    void chDJCS(QString bzxf,QString yxdl,QString djdl);
    void chDJMAX(QString maxxc);
    void targetPadPumpValue(QString yl);
    void targetArgonPumpValue(QString yl);
    void infolist(QStringList value);
    void dbGzwh();
    void sendConnectInfo(QString ipv,QString portv);
    void sendCpsData(double cpsData);
    void sendRadiationData(int module,double radiationData);
    void sendMessage(QString message);
    void needReset();
    void cameraConnect(bool connState);     // 摄像头返回是否连接成功
    void refreshJFCamera(int param2, void* pUserData);
    void partDetectorStatus(int type,int status);
    void unionStatus(int status);
    void dblsj(QString lsjyl);
    void dbcgqsl(QString cgqslv);

public:
    void emitExperimentStatus(int type, int status,QString msg);// 设备状态
    void emitRefExperimentLog(int step);
    void emitCommunicationStatus(int status);   // 0连接成功 1通信断开
    void emitVoiceAssistant(int status);        // 0连接成功 1通信断开
    void emitEnergySpectrumStatus(int status);
    void emitRefCommunicationLog();
    void emitSendErrorMsg(QString errorInfo,QString methodInfo,QString errorModule,int errorType);
    void emitSendResetMsg(QString status,int serial);
    void emitSendSyringRunMsg(QString status,QString serial);
    void emitSyringDataLack();
    void emitSendAirPumpPressure(QString openVal,QString closeVal);
    void emitSendTurnTablePos(QString turnTableVal);
    void emitModuleFinish(int module);
    void emitModuleCurrent(int module);
    void emitStepRunningStatus(int status);
    void emitSendTargetAirPumpPressure(QString airValue);
    void emitSendExistExp(int module,int step,QString actionInfo,int nextModule,int nextStep,QString nextActionInfo);
    void emitReceiveMsgOutTime();
    void emitGetExperimentInfo();

    void emitGetHeliumGasPump(QString pressureValue);
    void emitGetSuctionCupPressure(QString suctionCupValue);
    void emitGetMotorPosition(QString motorPos);
    void emitGetScrewCapInfo(QString speed,QString step);
    void emitSendPauseConfirmation();
    void emitTargetGasPumpValue(QString value);
    void emitTargetAirPumpValue(QString value);
    void emitSendMessage(QString message);
    Q_INVOKABLE void testEmitSignal();

    void emitfbGetAir(QString airValue);
    void emitdbhqGetAir(QString airValue);
    void emitdbxqbGetAir(QString airValue);
    void emitzbxpGetAir(QString airValue1,QString airValue2);
    void emitzbZZ(QString sd,QString wz);
    void emitzbXZ(QString sd,QString wz);
    void emitzbKG(QString sd,QString wz);
    void emitzbHX(QString sd,QString wz);
    void emitzbXPDJ(QString sd,QString wz);
    void emitzbRD(QString wz,QString sd);
    void emitchDJCS(QString bzxf,QString yxdl,QString djdl);
    void emitchDJMAX(QString maxxc);
    void emitTargetPadPumpValue(QString yl);
    void emitTargetArgonPumpValue(QString yl);
    void emitInfolist(QStringList value);
    void emitdbGzwh();
    void emitSendConnectInfo(QString ip,QString port);
    void emitSendCpsData(double cpsData);
    void emitSendRadiationData(int module,double radiationData);
    void emitNeedReset();
    void emitCameraConnect(bool connState);
    void emitRefreshJFCamera(int param2, void* pUserData);
    void emitPartDetectorStatus(int type,int status);
    void emitUnionStatus(int status);
    void emitdblsjyl(QString lsjyl);
    void emitdbcgqsl(QString cgqsl);
};
#endif // QMLSIGNAL_H
